﻿@{
    var returnUrl = Url.Action("Connect", "Connect", new { Area = "Piedone.Facebook.Suite.Connect", ReturnUrl = Model.ReturnUrl });
}

<a href="" id="facebook-connect-link" class="piedone-facebook-suite-connect connect-link">
    @T("Connect with Facebook")
</a>
<script type="text/javascript">
$(document).on("facebook:ready", function () {
    $.facebookConnect.initializeLogin("@Url.Encode(returnUrl)", "@Model.Permissions", "@Url.Action("SaveSession", "Connect", new { Area = "Piedone.Facebook.Suite.Connect" })", "@Html.AntiForgeryTokenValueOrchard()");
});
</script>
